home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
qbsnip.zip
/
REDIRCT.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-06-20
|
870b
|
31 lines
'From: Joe Negron
'Date: 05-20-97 22:48
DEFINT A-Z
'$INCLUDE: 'qb.bi'
DECLARE FUNCTION Redirected% ()
'***********************************************************************
'* FUNCTION Redirected%
'*
'* PURPOSE
'* Uses DOS ISR 21H, Function 44H (IOCTL - Get Device Information) to
'* determine if the program's output is being redirected.
'***********************************************************************
FUNCTION Redirected% STATIC
DIM IRegs AS RegType, ORegs AS RegType
IRegs.ax = &H4400 'IOOOCTL - Get Device Info
IRegs.bx = 1 'for STDOUT
Interrupt &H21, IRegs, ORegs 'Call DOS
Redirected% = -1 'Assume redirection
IF ORegs.dx AND &H80 THEN 'Then check
Redirected% = 0
END IF
END FUNCTION